package com.joy.mapper;

import com.joy.model.AssignmentSubmission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AssignmentSubmissionMapper {

    // 插入一个新的作业提交
    int insertAssignmentSubmission(AssignmentSubmission assignmentSubmission);

    // 根据ID查询作业提交
    AssignmentSubmission selectAssignmentSubmissionById(@Param("id") int id);

    // 查询所有作业提交
    List<AssignmentSubmission> selectAllAssignmentSubmissions();

    // 更新作业提交信息
    int updateAssignmentSubmission(AssignmentSubmission assignmentSubmission);

    // 删除作业提交
    int deleteAssignmentSubmissionById(@Param("id") int id);

    // 根据学生ID查询作业提交
    List<AssignmentSubmission> selectByStudentId(@Param("studentId") int studentId);

    // 根据任务ID查询作业提交
    List<AssignmentSubmission> selectByAssignmentId(@Param("assignmentId") int assignmentId);

    // 根据课程ID查询作业提交
    List<AssignmentSubmission> selectByCourseId(@Param("courseId") int courseId);

    // 根据学生ID、任务ID、课程ID查询单个作业提交
    AssignmentSubmission selectByCondition(@Param("studentId") int studentId,
                                           @Param("assignmentId") int assignmentId,
                                           @Param("courseId") int courseId);

    // 根据学生ID、任务ID、课程ID查询所有作业提交
    List<AssignmentSubmission> selectByCourseIdAndAssignmentId(@Param("assignmentId") int assignmentId,
                                                         @Param("courseId") int courseId);
}